package com.cmc.cloud.cmclink.doc.api.document.rep;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/**
 * 订舱预配信息 Base VO，提供给添加、修改、详细的子 VO 使用
 * 如果子 VO 存在差异的字段，请不要添加到这里，影响 Swagger 文档生成
 *
 * @author codegen
 */
@Data
public class SoForecastBaseDto {

    @Schema(description = "外键", requiredMode = Schema.RequiredMode.REQUIRED, example = "3921")
    private Long soId;

    @Schema(description = "箱型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotBlank(message = "箱型不能为空")
    @Length(max = 2, message = "箱型支持最大长度{max}")
    private String cntrType;

    @Schema(description = "箱尺寸 同尺寸拆分", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "箱尺寸 同尺寸拆分不能为空")
    @Length(max = 2, message = "箱尺寸 同尺寸拆分支持最大长度{max}")
    private String cntrSize;

    @Schema(description = "箱量 拆分规则 用户自己填写", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "箱量 拆分规则 用户自己填写不能为空")
    private Long cntrQuantity;

    @Schema(description = "单箱货重（kg", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "单箱货重（kg不能为空")
    private BigDecimal perCntrWgt;

//    public static CompareUtils<SoForecastBaseVO> getMultiFieldComparator() {
//        return new CompareUtils<SoForecastBaseVO>().comparingField(SoForecastBaseVO::getCntrType)
//                .thenComparing(SoForecastBaseVO::getCntrSize)
//                .thenComparing(SoForecastBaseVO::getCntrQuantity)
//                .thenComparing(SoForecastBaseVO::getPerCntrWgt);
//    }

}
